import datetime
import time

def get_date(dt):
    # 转换成时间数组
    timeArray = time.strptime(dt, "%Y%m%d")


    # 转换成时间戳
    timestamp = time.mktime(timeArray)
    # 转换成localtime
    time_local = time.localtime(timestamp)

    return time_local.tm_year, time_local.tm_mon, time_local.tm_mday

def get_date_list(date_begin, date_end):
    begin = datetime.date(*get_date(date_begin))
    end = datetime.date(*get_date(date_end))
    d = begin
    delta = datetime.timedelta(days=1)
    list_date = []
    while d <= end:
        list_date.append(d.strftime("%Y%m%d"))
        d += delta
    return list_date

if __name__ == '__main__':
    print(get_date_list("2016d0430", "20160505"))
